public class ShowProperties {
    public static void main(String[] args) {
        // 获取系统属性
        java.util.Properties properties = System.getProperties();

        System.out.println(System.getProperty("user.name"));
        System.out.println(System.getProperty("java.library.path"));

        // 打印所有系统属性
//        properties.list(System.out);
        for (String key : properties.stringPropertyNames()) {
            String value = properties.getProperty(key);
            System.out.println(key + ": " + value);
        }
    }
}
